package com.eatme.core.design.pattern.structural.composite;

public class Test {
    public static void main(String[] args) {
        CatalogComponent linuxCourse = new Course("linux课程",11);
        CatalogComponent windowsCourse = new Course("windows课程",12);
        CatalogComponent javaCourseCatalog = new CourseCatalog("Java课程目录",2);
        CatalogComponent mmallCourse1 = new Course("Java电商一期",55);
        CatalogComponent mmallCourse2 = new Course("Java电商二期",66);
        CatalogComponent designPattern = new Course("Java设计模式",77);
        javaCourseCatalog.add(mmallCourse1);
        javaCourseCatalog.add(mmallCourse2);
        javaCourseCatalog.add(designPattern);

        CatalogComponent eatmeCourseCatalog = new CourseCatalog("课程主目录",1);
        eatmeCourseCatalog.add(linuxCourse);
        eatmeCourseCatalog.add(windowsCourse);
        eatmeCourseCatalog.add(javaCourseCatalog);
        eatmeCourseCatalog.print();

    }
}
